﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for ChiTietDonHangEntity
/// </summary>
public class ChiTietDonHangEntity
{
    private int idCTDonHang;
    private string maDonHang;
    private string maSP;
    private int soLuong;
    private int donGia;
    private float thanhTien;
    public ChiTietDonHangEntity()
    { }
    public ChiTietDonHangEntity(int idCTDonHang, string maDonHang, string maSP, int soLuong, int donGia, float thanhTien)
    {
        this.idCTDonHang = idCTDonHang;
        this.maDonHang = maDonHang;
        this.maSP = maSP;
        this.soLuong = soLuong;
        this.donGia = donGia;
        this.thanhTien = thanhTien;
    }
    public int IdCTDonHang
    {
        get { return this.idCTDonHang; }
        set
        {
            if (value == null)
                throw new Exception("idCTDonHang not allow nullvalue.");
            this.idCTDonHang = value;
        }
    }
    public string MaDonHang
    {
        get { return this.maDonHang; }
        set { this.maDonHang = value; }
    }
    public string MaSP
    {
        get { return this.maSP; }
        set { this.maSP = value; }
    }
    public int SoLuong
    {
        get { return this.soLuong; }
        set { this.soLuong = value; }
    }
    public int DonGia
    {
        get { return this.donGia; }
        set { this.donGia = value; }
    }
    public float ThanhTien
    {
        get { return this.thanhTien; }
        set { this.thanhTien = value; }
    }
    public override string ToString()
    {
        return this.idCTDonHang + "; " + this.maDonHang + "; " + this.maSP + "; " + this.soLuong + "; " + this.donGia + "; " + this.thanhTien + "; ";
    }
    public override bool Equals(Object obj)
    {
        ChiTietDonHangEntity me = (ChiTietDonHangEntity)obj;
        bool ret = this.IdCTDonHang.Equals(me.IdCTDonHang);
        return ret;
    }
    public override int GetHashCode()
    {
        return this.IdCTDonHang.GetHashCode();
    }

}